#ifndef __BSP_H__
#define __BSP_H__

void bsp_lcd_io_initial(void);
void bsp_initial(void);

/**
 * @brief set key pin to pin number
 * 
 * @param n pin number
 */
void bsp_setKeyPin(int n);

/**
 * @brief read key state
 * 
 * @return int 
 */
int bsp_getKey(void);

/**
 * @brief set on board led2
 * 
 * @param state 1:light up, 0:turn off
 */
void bsp_setLed(int state);
void bsp_toggleLed(void);
void bsp_setVdd(int state);
void bsp_allio_low(void);

/**
 * @brief set pin output pp mode
 * 
 * @param n pin index 
 * @param pulltype 0:none 1:up 2:down
 */
void bsp_pinOutPP(int n, int pull_type);

/**
 * @brief set pin output od mode
 * 
 * @param n pin index 
 * @param pulltype 0:none 1:up 2:down
 */
void bsp_pinOutOD(int n, int pull_type);

/**
 * @brief set pin input mode
 * 
 * @param n pin index 
 * @param pulltype 0:none 1:up 2:down
 */
void bsp_pinIn(int n, int pull_type);

void bsp_setPin(int n, int state);
int bsp_getPin(int n);

void bsp_sendChar(char c);
void bsp_sendString(char* s);
char bsp_getChar(void);

/**
 * @brief check recive complet flag
 * 
 * @return 1:flag set, 0:no flag
 */
int bsp_getRxcpltFlag(void);

#endif //__BSP_H__
